﻿using SimpleServiceBus.Messages.Management.Monitoring;

namespace SimpleServiceBus.Persistence.Domain.Management.Repositories
{
    public interface IEndpointStatusRepository
    {
        /// <summary>
        /// AddEndpointStatus will be called each time a status message
        /// is received from an endpoint. This message will contain non-aggregated 
        /// endpoint measurements if the endpoint has any probes configured. Concurrently
        /// with this method, UpdateStatusSummaries will also be called, but instead of
        /// the raw measurements, the arguments to that method will be provided
        /// with aggregated values. It is probably not necessary to persist both
        /// styles, so you may want to choose to persist data fromeither AddEndpointStatus OR
        /// UpdateStatusSummaries but possibly not both. 
        /// </summary>
        /// <param name="status"></param>
        void AddEndpointStatus(EndpointStatusUpdateNotification status);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="error"></param>
        void AddEndpointError(EndpointErrorNotification error);
        void UpdateEndpointOnlineStatus(EndpointOnlineNotification onlineNotification);
        void UpdateEndpointOfflineStatus(EndpointOfflineNotification offlineNotification);
        void UpdateEndpointExpiredStatus(EndpointStatusExpiredNotification expiredNotification);
        void UpdateStatusSummaries(EndpointStatusSummaryNotification summaries);
    }
}